package com.yanyun.yczyy.api.controller;

import com.yanyun.yczyy.api.entities.ConfDynamicAlarm;
import com.yanyun.yczyy.api.repository.IConfDynamicAlarmRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
public class ConfDynamicAlarmController {
    @CrossOrigin(origins = {"*"})
    @GetMapping("/platform-api/conf/dynamicAlarm")
    public List<ConfDynamicAlarm> all() {
        return m_ConfDynamicAlarmRepository.all();
    }

    @CrossOrigin(origins = {"*"})
    @PostMapping("/platform-api/conf/dynamicAlarm")
    public boolean upsert(@RequestBody ConfDynamicAlarm conf) {
        return m_ConfDynamicAlarmRepository.upsert(conf);
    }


    @Autowired
    IConfDynamicAlarmRepository m_ConfDynamicAlarmRepository;
}
